Skip to content

Conversation

github-actions[bot]
Copy link

Backport 6b0cb07 from #3218.

…pletes

To generate the GATT Database Hash characteristic, the function
`db_hash_setup` is called. It allocates an entry for the AES key that will
be used in the CMAC calculation. Next, `db_hash_update` is called to feed
all GATT database entries into the hash. Finally, `db_hash_finish`
produces the resulting hash.

However, the AES key entry allocated in `db_hash_setup` was not being
destroyed after the hash generation completed. This caused a memory
leak, eventually leading to the error `PSA_ERROR_INSUFFICIENT_MEMORY`
(`-134`).

This commit fixes the issue by destroying the allocated AES key after
the GATT Database Hash calculation is complete, by calling
`psa_destroy_key` in `db_hash_finish`.

Signed-off-by: Pavel Vasilyev <[email protected]>
(cherry picked from commit bcdd74d)
(cherry picked from commit 6b0cb07)
@PavelVPV PavelVPV self-requested a review August 22, 2025 12:41
Copy link

@shanthanordic shanthanordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add refrence Jira ticket

@PavelVPV
Copy link
Contributor

@shanthanordic , NCSDK-34993

@PavelVPV PavelVPV requested a review from shanthanordic August 25, 2025 08:55
Copy link

@shanthanordic shanthanordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved for scope

@anangl anangl merged commit ba79a72 into ncs-v3.1-branch Aug 26, 2025
2 checks passed
@NordicBuilder
Copy link
Contributor

none

Note: This comment is automatically posted and updated by the Contribs GitHub Action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants